#ifndef __CCUSTOM_TABCTRL_CONTROL_H__
#define __CCUSTOM_TABCTRL_CONTROL_H__

#include <gdiplus.h>
using namespace Gdiplus;

class CCustomTabCtrl : public CTabCtrl
{
	DECLARE_DYNAMIC(CCustomTabCtrl)

//*************************************************************************************************//Class Function
public:
	CCustomTabCtrl(void);
	~CCustomTabCtrl(void);

	void SetBgDC(HDC hBgDC, HDC hMemDC);
	void SetString(const CString str0, const CString str1, const CString str2);

	void DrawUI();

private:
	void CreateFont();

//*************************************************************************************************//Class Parameters
public:
	BOOL m_bIsTracking, m_bHovered;

private:
	//Text Parameter
	CString m_strText[3];
	Gdiplus::Unit m_enFontUnit;
	Gdiplus::FontFamily* m_pFontFamily;
	Gdiplus::StringFormat* m_strTextFormat;
	
	int m_nFontSizeNormal, m_pFontSizeHilight, m_nFontStyleNormal, m_nFontStyleHilight;
	Gdiplus::SolidBrush* m_pBrushNormal, *m_pBrushHilight;
	Gdiplus::Font* m_pFontNormal, *m_pFontHilight;

	Image* m_pImg[4];
	HDC m_hBgDC, m_hMemDC;

//*************************************************************************************************//Class Message
public:
	virtual void DrawItem(LPDRAWITEMSTRUCT /*lpDrawItemStruct*/);
	DECLARE_MESSAGE_MAP()
	afx_msg void OnMouseMove(UINT nFlags, CPoint point);
	afx_msg LRESULT OnMouseLeave(WPARAM wparam, LPARAM lparam);
	afx_msg LRESULT OnMouseHover(WPARAM wparam, LPARAM lparam);
	afx_msg BOOL OnEraseBkgnd(CDC* pDC);
protected:
	virtual void PreSubclassWindow();
public:
	afx_msg void OnPaint();
};
#endif
